package com.ruoyi.zsyh.controller.applet.wechat.main;


import com.ruoyi.zsyh.controller.applet.wechat.menu.Button;
import com.ruoyi.zsyh.controller.applet.wechat.menu.Menu;
import com.ruoyi.zsyh.controller.applet.wechat.menu.ViewButton;
import com.ruoyi.zsyh.controller.applet.wechat.util.MenuUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * 菜单管理器类
 * 
 * @author
 */
public class PartsMenuManager {

	/**
	 * 组装菜单数据
	 * 
	 * @return
	 */
	private static Logger log = LoggerFactory.getLogger(PartsMenuManager.class);
	public static Menu getMenu() {



		ViewButton fjmd1 = new ViewButton();
		fjmd1.setName("扫码安装");
		fjmd1.setType("view");
//		fjmd1.setUrl("http://zsyhtest.com/parts.html#/scan");
        fjmd1.setUrl("https://www.zzzsyh.com/parts.html#/scan");

		ViewButton fjmd2 = new ViewButton();
		fjmd2.setName("申请补助金");
		fjmd2.setType("view");
//		fjmd2.setUrl("http://zsyhtest.com/parts.html#/scanMoney");
        fjmd2.setUrl("https://www.zzzsyh.com/parts.html#/scanMoney");

		ViewButton fjmd3 = new ViewButton();
		fjmd3.setName("申请记录");
		fjmd3.setType("view");
//		fjmd3.setUrl("http://zsyhtest.com/parts.html#/orderlist");
        fjmd3.setUrl("https://www.zzzsyh.com/parts.html#/orderlist");


		/**
		 * 这是公众号目前的菜单结构，每个一级菜单都有二级菜单项<br>
		 * 
		 * 在某个一级菜单下没有二级菜单的情况，menu该如何定义呢？<br>
		 * 比如，第三个一级菜单项不是“更多体验”，而直接是“幽默笑话”，那么menu应该这样定义：<br>
		 * menu.setButton(new Button[] { mainBtn1, mainBtn2, btn33 });
		 */
		Menu menu = new Menu();
		menu.setButton(new Button[] { fjmd1, fjmd2, fjmd3 });
		return menu;
	}

	public static void main(String[] args) {
		// 调用接口创建菜单
		boolean result = MenuUtil
				.createMenu(getMenu(), "32_fYe-Ef8S62BcTF7aDdW_OGVxj-lJsmjFTlYgVxBNLARNESMsbUrdGbLlNCxVj9XZUvAH9rnwebSDWhUYDloCd63iz7q9hv0eU9ysnMy5uVxUiHa9aZwMnJYtc_ws68IEHK_w6HpbzXKo7QVYMRTjAIAXCE");

		// 判断菜单创建结果
		if (result)
			log.info("菜单创建成功！");
		else
			log.info("菜单创建失败，错误码：" + result);
	}

}
